<div class="product">
	<style>
		.woocommerce-tabs div.entry_content.panel { padding-left:10px;padding-right:10px; }
		#tab-featuredproducts img { width:200px;height:200px; }
		td.featuredproducttitle { font-size:15px;font-weight:bold; }
		div.savebluebox { width:100px;height:30px;line-height:30px;text-align:center;font-size:12px;font-weight:bold;color:#ffffff;background:#263692;float:left;margin:0px; }
		div.featuredproductprice { width:100px;height:30px;line-height:30px;font-size:20px;font-weight:bold;color:#263692;float:left;margin:0px;margin-right:10px; }
	</style>
	
	<div class="woocommerce-tabs">
		<ul class="tabs">
			<li><a href="#tab-products">Products</a></li>
			<li><a href="#tab-faqs">FAQs</a></li>
			<li><a href="#tab-howtoguides">How-To Guides</a></li>
			<li><a href="#tab-learningcenter">Learning Center</a></li>
			<li><a href="#tab-documentsguides">Documents &amp; Guides</a></li>
			<li><a href="#tab-moreresources">More Resources</a></li>
			<div style="width:100%;height:0px;clear:both;"></div>
		</ul>
        
		<div class="panel entry-content" id="tab-products" >
        
			<?php if(is_product_category(array('Cold Climate Residential Solar Hot Water Kits', 'Warm Climate Residential Solar Hot Water Kits', 'Solar Domestic Hot Water Kits', 'Solar Residential Hot Water Systems'))) {
				include '/home/sunmaxxs/public_html/wp-content/themes/SunMaxxSolar/page-include-ressizingform.php';
			} ?>

            
            <div class="featuredcatproduct">
    <?php /**
                
                <?php if(get_field('catfeaturedproductone', 'product_cat_'.$category_ID.'') != '') { ?>
                 
                    <?php $featuredproductid = get_field('catfeaturedproductone', 'product_cat_'.$category_ID.''); ?>
                    <?php $featuredproduct = new wp_Query('post_type=product&p='.$featuredproductid.''); ?>
    
                <?php } else { ?>
                    <?php $featuredproduct = new wp_Query('post_type=product&cat='.$category_ID.'&showposts=1'); ?>
                <?php } ?>
                
                    <?php if($featuredproduct->have_posts()) { ?>
                
                    <h2 class="pagesubsectionheader">Featured Product</h2>
                
                    <?php while($featuredproduct->have_posts()) : 
                            $featuredproduct->the_post();
                ?>
                    
                    <?php
                        $productsku = get_post_custom($post->ID);
                        $showsku = $productsku['_sku'];
                        foreach ( $showsku as $showsku );
                        
                        $listprice = get_post_custom($post->ID);
                        $showlistprice = $listprice['_regular_price'];
                        foreach ( $showlistprice as $showlistprice );
	
                        $youpay = get_post_custom($post->ID);
                        $showyoupay = $youpay['_sale_price'];
                        foreach ( $showyoupay as $showyoupay );
                        
                        $savings = (($showlistprice - $showyoupay) / $showlistprice);
                        $showsavings = $savings * 100;
                    ?>
                    
                    <div class="featuredcatproductimage">
                        <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID )); ?>
                        <a href="<?php the_permalink(); ?>"><img  src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width="110" height="110" /></a>
                    </div>
                    <div class="featuredcatproductcontenttop">
                        <h2 style="margin-bottom:5px;"><?php the_title(); ?></h2>
                        <p style="font-size:11px;font-style:italic;color:#747170;"><?php echo $showsku; ?></p>
                    </div>
                    <div class="featuredcatproductcontentbottom">
                        <div class="featuredcatproductontentbottomleft">
                            <?php the_excerpt(); ?>
                        </div>
                        <div class="featuredcatproductontentbottomright">
                            <h3 style="font-size:20px;font-weight:bold;color:#263692;">$<?php echo $showyoupay; ?></h3>
                            <p style="text-decoration:strike-through;">List Price: $<?php echo ($showlistprice); ?></p>
                            <div style="margin-bottom:15px;">Save <?php echo round($showsavings); ?>%</div>
                            <p><a class="button" href="<?php the_permalink(); ?>">View Product</a></p>
                        </div>
                    </div>
                    
                    <div style="width:100%;height:0px;clear:both;"></div>
                        
                    <?php endwhile; ?>

                <?php wp_reset_query() ; ?>
                <?php } ?>
             * 
             * 
             */?>

                    
                <!-- Insert The Category Products Or Sub-Categories In The First Tab -->
                    
                <?php if ( have_posts() ) : ?>

			<?php
				/**
				 * woocommerce_before_shop_loop hook
				 *
				 * @hooked woocommerce_result_count - 20
				 * @hooked woocommerce_catalog_ordering - 30
				 */
				do_action( 'woocommerce_before_shop_loop' );
			?>

			<?php woocommerce_product_loop_start(); ?>

				<?php woocommerce_product_subcategories(); ?>

					<?php if (is_product_category('Solar Hot Water Installation Training')) { ?>
						<li class="producttabletitlerow" style="background:#f2f2f2;font-weight:bold;">
							<span style="display:inline-block;height:30px;line-height:30px;width:170px;padding-left:10px;">Month</span>
							<span style="display:inline-block;height:30px;line-height:30px;width:170px;">Dates</span>
							<span style="display:inline-block;height:30px;line-height:30px;width:170px;">Location</span>
							<span style="display:inline-block;height:30px;line-height:30px;width:170px;">Levels</span>
							<span style="display:inline-block;height:30px;line-height:30px;width:170px;">Instructor</span>
							<span style="display:inline-block;height:30px;line-height:30px;float:right;margin:0px;text-align:right;padding-right:10px;">Details &amp; Sign Up</span>
						</li>
					<?php } ?>

				<?php while ( have_posts() ) : the_post(); ?>

                                    <?php woocommerce_get_template_part( 'content', 'product' ); ?>

				<?php endwhile; // end of the loop. ?>

			<?php woocommerce_product_loop_end(); ?>

			<?php
				/**
				 * woocommerce_after_shop_loop hook
				 *
				 * @hooked woocommerce_pagination - 10
				 */
				do_action( 'woocommerce_after_shop_loop' );
			?>

		<?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>

			<?php woocommerce_get_template( 'loop/no-products-found.php' ); ?>

		<?php endif; ?>
                    
                <?php // End The Product / Sub-Category Section ?>
                
    	</div>

    </div>

	<div id="tab-faqs" class="panel entry-content">
		<h3 class="widget-title" style="font-size:15px;font-weight:bold;">Frequently Asked Questions</h3>
        <p style="font-weight:bold;">Check out our great FAQs and Answers for our <?php echo single_term_title( "", false ); ?> below:</p>

		<?php if (is_product_category('Solar Hot Water Installation Training')) { ?>
		<ul style="padding-left:10px;margin-left:10px;">
		<?php // QUERY FAQs
			$args = array(
				'post_type' => 'post',
				'tag' => 'rel_training',
				'category__in' => array(4)
			);

			$trainingfaqs = new wp_query($args);
			while($trainingfaqs->have_posts()) : $trainingfaqs->the_post();
		?>
				<li><a href="<?php the_permalink(); ?>" target="_blank"><?php the_title(); ?></a></li>
		<?php
			endwhile;
			wp_reset_query();
		?>
		</ul>
		<?php } else { ?>
			<?php the_field('catfaqcontent', 'product_cat_'.$category_ID.''); ?>
		<?php } ?>
        
	</div>
    <div id="tab-howtoguides" class="panel entry-content">
		<h3 class="widget-title" style="font-size:15px;font-weight:bold;">Category How-To Guides</h3>
        <p style="font-weight:bold;">Check out our great DIY and How-To Guides for our <?php echo single_term_title( "", false ); ?> below:</p>
        
        <?php the_field('cathowtocontent', 'product_cat_'.$category_ID.''); ?>
		
	</div>
	<div id="tab-learningcenter" class="panel entry-content">
		<h3 class="widget-title" style="font-size:15px;font-weight:bold;">Category Learning Guide</h3>
        <p style="font-weight:bold;">Check out our great Information &amp; Learning Guides for our <?php echo single_term_title( "", false ); ?> below:</p>
        
	</div>

	<div id="tab-documentsguides" class="panel entry-content">
		<?php if (is_product_category('Solar Hot Water Installation Training')) { ?>
			<h3 style="font-size:15px;font-weight:bold;">Training Documents &amp; Guides</h3>
			<ul style="padding-left:10px;margin-left:10px;">
				<?php // Query Related Product Documents
					$args = array(
						'post_type' => 'document',
						'tax_query' => array(
							array(
								'taxonomy' => 'wpdr-file-tags',
								'field' => 'slug',
								'terms' => 'rel_training'
							)
						)
					);

					$trainingdocs = new wp_query($args);
					while($trainingdocs->have_posts()) : $trainingdocs->the_post();
				?>
					<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
				<?php
					endwhile;
					wp_reset_query();
				?>
			</ul>
		<?php } else { ?>
			<?php include '/home/sunmaxxs/public_html/wp-content/themes/SunMaxxSolar/page-include-document-tag-list.php'; ?>
		<?php } ?>
		<?php the_field('catlearninguidecontent', 'product_cat_'.$category_ID.''); ?>
	</div>

	<div id="tab-moreresources" class="panel entry-content">
		<h3 class="widget-title" style="font-size:15px;font-weight:bold;">Additional &amp; Related Resources</h3>
        <p style="font-weight:bold;">Check out our great Documents &amp; Additional Resources for our <?php echo single_term_title( "", false ); ?> below:</p>
        
        <ul>
			<li><a href="http://www.siliconsolar.com/publication/silicon-solar-company-brochure/wppa_open">Silicon Solar Company Information Brochure</a></li>
			<li><a href="http://www.siliconsolar.com/publication/sunmaxx-company-information-brochure/wppa_open">SunMaxx Company Information Brochure</a></li>
			<li><a href="http://techvideos.siliconsolar.com" target="_blank">Solar How-To &amp; Troubleshooting Videos</a></li>
            <li><a href="http://www.solarwebinars.com" target="_blank">Interested In Solar Hot Water? Check Out Our Solar Hot Water Training Videos</a></li>
            
            <?php // Include Link To SolarHotWater.SiliconSolar.com On Hot Water Category Pages
				if (is_tax( 'product_cat', array( 'solar-hot-water-heaters', 'flat-plate-solar-collectors', 'solar-evacuated-tube-collectors', 'u-pipe-evacuated-tube-solar-collectors', 'replacement-evacuated-tubes', 'thermosyphon-solar-hot-water', 'demo-solar-hot-water-collectors', 'solar-water-storage-tanks', 'residential-solar-storage-tanks', 'non-pressurized-storage-tanks', 'non-pressurized-storage-tank-accessories', 'marathon-residential-solar-storage-tanks', 'solar-pumping-stations', 'stormaxx-dw-solar-storage-tanks', 'stormaxx-pressurized-buffer-tanks', 'stormaxx-se-solar-storage-tanks', 'stormaxx-simple-drainback-storage-tanks', 'solar-hot-water-accessories', 'pre-packaged-solar-thermal-systems', 'solar-glycol-heat-transfer-fluids', 'solar-glycol-xt', 'pre-insulated-line-set', 'solar-expansion-tanks', 'solar-heat-exchangers', 'solar-hot-water-circulator-pumps', 'solar-hot-water-drainback-tanks-accessories', 'solar-hot-water-mounting-hardware', 'solar-plumbing-hardware', 'solar-simulation-software', 'solar-water-storage-controllers-and-stations', 'solar-commercial-hot-water-systems', 'solar-residential-hot-water-systems', 'heliomaxx-combi-kits', 'cold-climate-residential-solar-hot-water-kits', 'warm-climate-residential-solar-hot-water-kits', 'basic-pre-insulated-line-set', 'buried-pre-insulated-line-set', 'pre-insulated-line-set-hardware', 'air-to-water-solar-heat-exchangers', 'brazed-plate-solar-heat-exchangers', 'butler-solar-wand-heat-exchangers', 'shell-tube-solar-heat-exchangers', 'el-sid-dc-circulator-pumps', 'grundfos-solar-circulator-pumps', 'laing-solar-circulator-pumps', 'polysun-software-packages', 'solar-pool-heaters', 'solar-pool-heater-accessories', 'fafco-solar-pool-heaters', 'solar-pump-stations', 'solar-controller-accessories', 'solar-water-storage-controllers' ) ) ) {
					echo '<li><a href="http://solarhotwater.siliconsolar.com" target="_blank">Solar Hot Water Information &amp; Learning Guide</a></li>';
			} ?>
            
		</ul>

	</div>
    </div>
</div>